<template>
  <el-table
    :data="tableData"
    border
    style="width: 100%"
  >
    <el-table-column type="index" label="序号" min-width="40" align="center" />
    <el-table-column
      prop="qid"
      label="题目ID"
      width="150"
    />
    <el-table-column
      prop="submitHomeworkFile"
      label="提交作业文件"
      width="120"
    >
      <template slot-scope="scope">
        <el-link v-if="scope.row.submitHomeworkFile" :href="scope.row.submitHomeworkFile">
          {{ scope.row.submitHomeworkFile }}
        </el-link>
      </template>
    </el-table-column>
    <el-table-column
      prop="submitTime"
      label="提交时间"
      width="200"
    />
    <el-table-column
      prop="ifCorrected"
      label="是否批改"
      width="200"
    >
      <template slot-scope="scope">
        <el-tag :type="scope.row.ifCorrected === true ? 'success' : ''">
          {{ scope.row.ifCorrected === true ? '已批改' : '待批改' }}
        </el-tag>
      </template>
    </el-table-column>
    <el-table-column
      prop="tid"
      label="教师ID"
      width="150"
    >
      <template slot-scope="scope">
        {{ scope.row.tid ? scope.row.tid :'暂无' }}
      </template>
    </el-table-column>
    <el-table-column
      prop="remarks"
      label="分数"
      width="150"
    >
      <template slot-scope="scope">
        {{ scope.row.remarks ? scope.row.remarks :'暂无' }}
      </template>
    </el-table-column>
    <el-table-column
      prop="correctTime"
      label="批改时间"
      width="150"
    >
      <template slot-scope="scope">
        {{ scope.row.correct_time ? scope.row.correct_time :'暂无' }}
      </template>
    </el-table-column>
<!--    <el-table-column-->
<!--      fixed="right"-->
<!--      label="操作"-->
<!--      width="100"-->
<!--    >-->
<!--      <template slot-scope="scope">-->
<!--        <el-button type="primary" size="small" @click="handleClick(scope.row)">查看</el-button>-->
<!--      </template>-->
<!--    </el-table-column>-->
  </el-table>
</template>
<script>
import {submitedWork} from "../../api/work";

export default {
  components: {},
  data() {
    return {
      tableData: []
    }
  },
  created() {
     this.getList()
  },
  methods: {
    getList() {
      submitedWork().then(res=> {
        this.tableData = res.data.list
      }).catch(err => {
        this.$message.error('请求失败！')
      })
    }
  }
}
</script>
<style scoped></style>
